#pragma once

#include <iostream>
#include <vector>
#include <string>
#include <ctime>
typedef void (*task_t)();

void task1()
{
    std::cout << "Task 1" << std::endl;
}

void task2()
{
    std::cout << "Task 2" << std::endl;
}

void task3()
{
    std::cout << "Task 3" << std::endl;
}

class Task 
{
public:
    Task() 
    {
        srand(time(nullptr));
    }

    void add_task(task_t task) 
    {
        tasks.push_back(task);
    }

    int code()
    {
        return rand() % tasks.size();
    }

    void Excute(int code)
    {
        if(code >= 0 && code < tasks.size())
        {
            tasks[code]();
        }
    }
    ~Task() {}


private:
    std::vector<task_t> tasks;
};